1. Field of the Invention
The invention relates to a data programming method, and more particularly to a data programming method for reducing the time it takes for programming.
2. Description of the Related Art
FIG. 1 is a diagram of a conventional memory structure. A non-volatile memory, such as a flash memory, comprises at least one memory unit 100, and the memory unit 100 comprises 1024 memory blocks Block0-Block1023. Each memory block comprises 64 pages, and each page comprises four sectors. As shown in FIG. 1, the memory block BlockM comprises 64 pages Page0-Page63, and the page PageN comprises four sectors Sector0-Sector3, wherein M is a positive integer from 0 to 1023, and N is a positive integer from 0 to 63. Each sector has 512-byte storage space, and one page is a unit for data programming.
It is assumed that a conventional memory unit desires to program two data in the same page. The memory unit first receives first data to be programmed into the page Page0 of the memory block BlockM. If the page Page0 is empty, the memory unit programs the first data into the page Page0. After, when the memory unit receives second data to be programmed into the page Page0, the data of the other pages (such as Page1-Page63) are backed up into volatile memory (not shown in FIG. 1) or other memory blocks, and then the entire memory block BlockM is erased. Finally, the second data is programmed into the page Page0 of the memory block BlockM, and the un-changed data is programmed back into the memory block BlockM from the volatile memory (not shown in FIG. 1) or the other memory blocks. Since the time period taken by the memory unit to erase data is longest and next longest time period taken is the time period taken by the memory unit to program data, the time it takes for erasing data from the pages and programming data into pages can be decreased for shortening the time period for data programming.